package practice

import "sync"

//单例模式struct
type single struct {
	O interface{}
}

var instantiated *single
var once sync.Once

func New() *single {
	once.Do(func() {
		instantiated = &single{}
	})
	return instantiated
}
